<!-- 指令 -->
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.Scanner"  %>
<%@ page import="java.util.Date" %>
<html>
<head>
    <title>JSP组成</title>
    <style>
        h2{
            color: #f00;
        }
    </style>
    <script>
        console.log('welcome to jsp');
    </script>
</head>
<body>
    <h2>welcome to jsp</h2>

    <%@include file="hello.jsp"%>

    <!-- 小脚本  -->
    <%
        String name = "tom";
        System.out.println(name);

        Date date = new Date();
        System.out.println(date);
    %>

    <!-- 表达式 -->
    <%=name %>

    <!-- 声明 -->
    <%! int age = 18; %>
    <%=age %>

    <!-- HTML注释 -->
    <%-- JSP注释 --%>

    <%--
        案例
    --%>
    <ul>
        <%
            String[] names = {"tom","jack","alice","mike"};
            for(String n : names){
        %>
                <li><%=n %></li>
        <%
            }
        %>
    </ul>

</body>
</html>
